﻿<?php
/* TravelTaste(C) 2009 - 2010
  *sim.php  - 提供模拟环境，例如模拟用户登录等
  *$2010-4-3
* Author: Yuhuang@ncic.ac.cn
*/

/* 检查登录信息
 * Note: 调用此函数前，要求session_start()已经被调用 
 */
function check_user_login($uname, $pword)
{	
	if (isset($_SESSION['login']) && $_SESSION['login']== true)
	{
		return true; // 已经登录
	}
	else
	{
		
		$_SESSION['user'] = array(
			"uid" => 30,
			"user" => "raywill",
			"pass" => "111111", 	
			"email" => "raywill2010@gmail.com", 	
			"register_date" => "2010-04-01", 	
			"last_ip" => "10.10.30.1", 	
			"sex" => 'M', 	
			"image_path" => "030.gif",	
			"real_name" => "余璜",	
			"birthday" => "1986-10-01", 	
			"hometown" => "黄州", 	
			"current_city" => "海南", 	
			"service_provided" => 7, 	
			"reception_times" => 10, 	
			"page_visit_times" => 25, 	
			"self_description" => "大家好,我是余璜",
			"reception_requirement" => "希望你干净整洁，喜欢打球"
		);	
	
/*		
		$_SESSION['user'] = array(
			"uid" => 31,
			"user" => "idning",
			"pass" => "111111", 	
			"email" => "idning2010@gmail.com", 	
			"register_date" => "2010-04-01", 	
			"last_ip" => "10.10.31.1", 	
			"sex" => 'M', 	
			"image_path" => "031.gif",	
			"real_name" => "杨林",	
			"birthday" => "1987-10-01", 	
			"hometown" => "曲靖", 	
			"current_city" => "昆明", 	
			"service" => 4, 	
			"reception_times" => 4, 	
			"page_visit_times" => 15, 	
			"self_description" => "大家好,我是杨林,欢迎来到彩云之南"
		);	


		$_SESSION['user'] = array(
			"uid" => 34,
			"user" => "wanghe",
			"pass" => "111111", 	
			"email" => "wanghe2010@gmail.com", 	
			"register_date" => "2010-04-01", 	
			"last_ip" => "10.10.34.1", 	
			"sex" => 'F', 	
			"image_path" => "034.gif",	
			"real_name" => "王鹤",	
			"birthday" => "1987-09-23", 	
			"hometown" => "西安", 	
			"current_city" => "北京", 	
			"service" => 1, 	
			"reception_times" => 20, 	
			"page_visit_times" => 25, 	
			"self_description" => "欢迎来北京，我在人大！"
		);
*/			
/*		
		$_SESSION['user'] = array(
			"uid" => 35,
			"user" => "buou",
			"pass" => "111111", 	
			"email" => "buou2010@gmail.com", 	
			"register_date" => "2010-04-01", 	
			"last_ip" => "10.10.35.1", 	
			"sex" => 'F', 	
			"image_path" => "035.gif",	
			"real_name" => "欧阳霄",	
			"birthday" => "1987-09-23", 	
			"hometown" => "黄冈", 	
			"current_city" => "北京", 	
			"service" => 0, 	
			"reception_times" => 0, 	
			"page_visit_times" => 5, 	
			"self_description" => "欢迎来北京，放假了也欢迎去我的家乡黄冈，我用黄冈兵法迎接你！"
		);	
*/			
		$_SESSION['login'] = true;
		
		return true;
	}
}

?>